<template>
    <div>
        <div  v-if="info.length!=0">
        <Header class="head">
            <li slot="top"> <span class="iconfont icon-icon-arrow-left4" @click="jump_totals()"></span></li>
            <li slot="top"><span class="iconfont icon-gengduo"></span></li>
      </Header>
            <div>
                <OneLOgo :img="info.img" :title="info.title" :one_page_peoples="info.one_page_info.one_page_peoples" :one_page_update="info.one_page_info.one_page_update" :one_page_status="info.one_page_info.one_page_status"></OneLOgo>
            </div>
            <div>
                <div v-for="(item,index) in info.one_page_info.one_page_list" :key="index" @click='jump_details(item.list_id,{"list_title":item.list_title,"date":item.list_date,"list_img":item.list_img,"details_img":item.details_img})'>
                    
                    <OneDL class="onedl" :list_title="item.list_title"  :list_date="item.list_date"  :list_img="item.list_img"></OneDL>
                </div>
            </div>
        </div>
     
    </div>
</template>

<script>
import OneDL from "@/components/one_list_dl.vue"
import OneLOgo from "@/components/one_list_headlogo.vue"
import Header from "@/components/index_head.vue"
export default {
    components:{
        OneLOgo,
        OneDL,
        Header
    },
    data(){
        return {
            info:""
        }
    },
    methods:{
        jump_details(list_id,detail){
            this.$router.push({path:"/details",query:{id:list_id,det_info:detail}})
            console.log(list_id)
        },
        jump_totals(){
            this.$router.push("/totals")
        }
    },
   
    mounted(){
        //获得了页面传来的id    
        //如果是是数据库 发请求 参数为id 查找对应的数据
        let id=this.$route.query.id;
        console.log(id)

        // let arr=this.$store.state.totalsx.new_totalsinfo
       this.$store.state.totalsx.new_totalsinfo.forEach((item)=>{
            if(item.id === +id){
                this.info=item;
                console.log(this.info)
                
            }
        })
    }
}
</script>

<style scoped lang="scss">
.onedl{
    margin-bottom: .1rem;
}
.head{
    display: flex;
    justify-content: space-between;
    .iconfont{
        font-size: .18rem;
        margin: 0 .14rem;
    }
}

</style>